<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>窗口大小与位置</title>
	</head>
	<body>
		<p>
			<input type="button" value="打开窗口" onclick="openWin()" />
		</p>
		<p>
			<input type="button" value="调整窗口的大小和位置" onclick="changeWin()" />
		</p>
		<script>
			//定义窗口
			var mywin;
			//获取窗口的信息（宽高...）
			function getWinMessage(){
				//相对于屏幕窗口的坐标
				mywin.document.write("相对于屏幕窗口的坐标："+mywin.screenx+","+mywin.screenY);
				//文档窗口的高度
				mywin.document.write("窗口文档的宽度和高度："+mywin.innerWidth+","+mywin.innerHeight+"<br />");
				//窗口外部的宽高
				mywin.document.write("窗口外部的宽度和高度："+mywin.outerWidth+","+mywin.outerHeight);
			}
			function openWin(){
				mywin=open('','我的新窗口','width=250,height=300');
				getWinMessage();
				
			}
			function changeWin(){
				mywin.moveBy(250,250);
				mywin.resizeTo(500,350);
				getWinMessage();
			}
		</script>
	</body>
</html>
